Skip to content

[AIR Validation to Backend] Pre-flight config against ValidateConfig before submit - #6205

Open
riddhibhagwat-db wants to merge 2 commits into
air-clifrom
riddhibhagwat-db/air-validate-config-client
Open

[AIR Validation to Backend] Pre-flight config against ValidateConfig before submit#6205
riddhibhagwat-db wants to merge 2 commits into
air-clifrom
riddhibhagwat-db/air-validate-config-client

Conversation

@riddhibhagwat-db

@riddhibhagwat-db riddhibhagwat-db commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What & why

air run now pre-flights the config against the backend ValidateConfig RPC before uploading anything, so a bad config fails fast with the server's field-level errors instead of after the code snapshot is packaged and uploaded. The same rules back the submit gate, so the pre-flight can't disagree with what submission enforces.

(See 1DD: https://docs.google.com/document/d/1xWKHisVk9YbsnmWyHE1J5OOTZTIHx2DSiyrkuTNM0NA/edit?tab=t.0#heading=h.culzh2kyug09 )

How do you know it works?

validateconfig_test.go covers valid→pass, errors→blocking message (each pointing at its config field), fail-open on both FEATURE_DISABLED and 404, and the request-shape mapping (incl. omitting unset options). The submit acceptance tests (run-submit, run-submit-deps) exercise the pre-flight end-to-end: it fires, is served, and submission proceeds. go test ./experimental/air/... and the air acceptance tests pass.

Manual verification (tested with the corresponding backend in liteswap pod):
Screenshot 2026-08-11 at 12 00 38 PM

How to review

  • validateconfig.go: preflightValidate builds the {task, run_options} body from runConfig, POSTs to /api/2.0/ai-training/config:validate (raw client.Do, since the SDK doesn't model AiTrainingService, matching aitraining.go), and renders any FieldErrors.
  • the endpoint is behind a SAFE flag (default off) and older workspaces lack it, so FEATURE_DISABLED / 404 / 501 skip the check and let submission proceed and only a populated error list blocks.
  • runsubmit.go the call is the first thing submitWorkload does, before token/policy resolution and any upload.
  • --dry-run is unchanged since it stays local-only and needs no workspace

`air run` now checks the config server-side before uploading anything, so a bad
config fails fast with the backend's field-level errors instead of after the
code snapshot is packaged and uploaded. The same rules back the submit gate, so
the pre-flight can't disagree with what submission enforces.

Fails open: the endpoint is behind a SAFE flag and older workspaces don't have
it, so a disabled or missing endpoint skips the check and lets submission
proceed (where the config is validated again, authoritatively). Only a populated
error list -- a config the server actively rejected -- blocks.

--dry-run stays local-only and needs no workspace; the pre-flight is on the
submit path, where it saves the wasted upload.
@riddhibhagwat-db riddhibhagwat-db changed the title [air] Pre-flight config against ValidateConfig before submit [AIR Validation to Backend] Pre-flight config against ValidateConfig before submit Aug 7, 2026
@riddhibhagwat-db
riddhibhagwat-db marked this pull request as ready for review August 7, 2026 23:43
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/experimental/air/ - needs approval

Files: acceptance/experimental/air/run-submit-deps/test.toml, acceptance/experimental/air/run-submit/test.toml
Suggested: @vinchenzo-db
Also eligible: @apeforest, @bfontain, @lu-wang-dl, @panchalhp-db, @maggiewang-db, @ben-hansen-db, @pardis-beikzadeh-db

/experimental/air/ - needs approval

4 files changed
Suggested: @vinchenzo-db
Also eligible: @apeforest, @bfontain, @lu-wang-dl, @panchalhp-db, @maggiewang-db, @ben-hansen-db, @pardis-beikzadeh-db

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 8ced828

Run: 31535618033

Env 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 291 1103 8:03
💚​ aws windows 4 4 293 1101 6:34
💚​ azure linux 4 4 290 1103 8:26
🔄​ azure windows 2 4 4 290 1101 6:28
💚​ gcp linux 1 5 291 1103 9:42
💚​ gcp windows 1 5 293 1101 6:32
10 interesting tests: 4 RECOVERED, 4 SKIP, 2 flaky
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestFsCpFileToNonExistentDir ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
🔄​ TestFsCpFileToNonExistentDir/uc-volumes_to_dbfs ✅​p ✅​p ✅​p 🔄​f ✅​p ✅​p
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 6 slowest tests (at least 2 minutes):
duration env testname
6:10 aws windows TestAccept
6:05 gcp windows TestAccept
5:49 azure windows TestAccept
2:57 gcp linux TestAccept
2:56 aws linux TestAccept
2:51 azure linux TestAccept

Three golangci-lint failures on the PR:
  - endpointUnavailable: errors.As -> errors.AsType[T] (forbidigo).
  - preflightValidate: os.Getenv -> env.Get(ctx, ...) (forbidigo); ctx is
    already in scope and env.Get falls back to the process env, so the
    AIR_LITESWAP_ID behavior is unchanged.
  - test: drop the intPtr helper for the new(v) builtin (modernize).

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants